﻿using System;
using System.Web.Mvc;
using StructureMap;


namespace Wayloop.Blog.DependencyResolution
{
    public class ControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(Type controllerType)
        {
            if (controllerType != null && typeof (IController).IsAssignableFrom(controllerType)) {
                return ObjectFactory.GetInstance(controllerType) as IController;
            }

            return base.GetControllerInstance(controllerType);
        }
    }
}